<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">
<h:body>
	<ui:composition template="templates/commonPage.xhtml">
		<ui:define name="pagecontent">
			<h1>All Offers</h1>
			
			<hr />
			<div class="buttoncart">
				<h:form styleClass="formcart">
					<h:commandButton
						styleClass="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-icon-left"
						action="#{shoppingCartMB.viewCart}" value="Check my cart"
						icon="ui-icon-check" style="margin-left:10px;" />
				</h:form>
			</div>
			<br style="clear: both" />
			<div class="row">
				<ui:repeat var="offer" value="#{offersListMb.listOffer}">
					<div class="span6 thumb-list">
						<h:form id="Form">
							<p:fieldset legend="#{offer.labelOffer}">
								<a rel="lightbox[secondary]"
									href="templates/img/thumb-small01.png">
									<h:graphicImage	value="#{offer.supplierOffer.description.miniPhotoDescription}" />
									
									</a>
									
									
								<h3>									
										<p:commandLink value="#{offer.supplierOffer.activity.labelActivity}" action="offerDetails?faces-redirect=true"
										actionListener="#{offersListMb.getOfferDetails}">
										<f:attribute name="offerId" value="#{offer.idOffer}"></f:attribute>
										</p:commandLink>
								</h3>

								<h:outputText
									value="#{offer.supplierOffer.description.textDescription}" />

								<br />
								<div class="divprice">
									<h:outputText value="ATI #{offer.rate.price.preTaxPrice*loginMB.taxChangeCoeff} " ><f:convertNumber maxFractionDigits="2" minFractionDigits="2"/></h:outputText><h:outputText value="#{loginMB.currency}" /><br/>
								    <h:outputText value="TE  #{offer.rate.price.preTaxPrice*loginMB.changeCoeff} " ><f:convertNumber maxFractionDigits="2" minFractionDigits="2"/></h:outputText><h:outputText value="#{loginMB.currency}" /><br/>
								</div>

								<p:commandButton styleClass="cartButton"
									action="#{shoppingCartMB.addCart}" value="Add to cart"
									actionListener="#{shoppingCartMB.action}" icon="ui-icon-check"
									style="margin-left:10px;">
									<f:attribute name="offerId" value="#{offer.idOffer}" />
									<f:attribute name="costOffer"
										value="#{offer.rate.price.preTaxPrice}" />
									<f:attribute name="label" value="#{offer.labelOffer}" />
								</p:commandButton>
							</p:fieldset>
						</h:form>
					</div>
				</ui:repeat>
			</div>
			<br />
		</ui:define>
	</ui:composition>
</h:body>
</html>